﻿using DataWorks_Sqlite.MappingClass;
using DataWorks_Tools.BasicMethods;
using DataWorks_Tools.CleanDetails;
using DataWorks_Tools.ConverttoCSVI;
using DataWorks_Tools.MappModals;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataWorks_Tools.ProcessExcute.ConverttoCSVI
{
    public class ConverttoCSVIProcess
    {

        public static async  Task<List<string>> ConverttoCSVIProcessExcute(dw_props_admin dw_Props_Admin ,dw_props_convertcsvi modal)
        {
            var selectdatefilearray = modal.selecteddirectory.ReComma().Split(',');
            var originaldatapath = modal.originaldatapath.YXHPathReplace();
            var savedatapath = modal.savedatapath.YXHPathReplace();

            var row = new CSVIModalforProcess();
            row.csvithread = dw_Props_Admin.cleanthreadnumber;
            row.odpath = originaldatapath;
            row.datedir = selectdatefilearray;
            row.rdpath = savedatapath;
            if (originaldatapath != null && selectdatefilearray != null && savedatapath != null)
            {
                var t = await ConvertoCSVIDetails.YXHExcuteConverttoCSVIMultiThreadsAsync(row);
                return t;
            }
            else
            {
                return new List<string>() { "参数错误" };
            }
        }
    }
}
